#include "salefectory.h"
#include"poco/sale/saleSetMeal.h"
#include"poco/sale/saleUnit.h"
#include"poco/sale/saleWeight.h"



SaleBase* SaleFectory::CreateSale(int type)
{
    Q_UNUSED(type);
    return nullptr;
}


SaleBase* InitSaleFectory::CreateSale(int type)
{
    SaleBase* sale=SaleFectory::CreateSale(type);
    if(sale!=nullptr)
        return sale;
    switch (type) {
    case SaleBase::CLASS_SALEBASE:
        return new SaleBase;
    case SaleBase::CLASS_SALEUNIT:
    case SaleBase::Class_SIDEDISH://配菜和单品一样
        return new SaleUnit;
    case SaleBase::CLASS_SALEWEIGHT:
        return new SaleWeight;
    case SaleBase::CLASS_SALESETMEAL:
        return new SaleSetMeal;
    default:
        return nullptr;
    }
}
